drop redundant MAX_VIRT_CPUS bounds checks
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 22 Jan 2015 11:46:43 +0000 (12:46 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 22 Jan 2015 11:46:43 +0000 (12:46 +0100)
commitd9e66702fd9e1cf7a8e7fa3b28879cd6f779bac5
tree6684a524cbdd67fc0d576a456cb9c6be3e33e99b
parent84f5ec57aeea210003b3b76a1e7a02fc65a81b82
drop redundant MAX_VIRT_CPUS bounds checks

In all 4 cases, visible in the context are bounds check against d->max_vcpus.
Domain building will ensure that d->max_vcpus never exceeds an appropriate
bound.  In the x86 case, different types of domains have different maxima for
vcpus, making the checks wrong as opposed to simply redundant.

For vpsci in ARM, 'vcpuid' is an unsigned type so could never be less than 0.

For the common changes to do_{,compat}_vcpu_op(), these changes do result in a
guest visible change, but only in so far as certain invalid vcpu ids will now
fail with -ENOENT rather than -EINVAL.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/vpsci.c
xen/arch/x86/domctl.c
xen/common/compat/domain.c
xen/common/domain.c